﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn"	uri="http://java.sun.com/jsp/jstl/functions"%>
<div class="col-lg-4 col-md-4 zz-startup-right-layout">
  
  <c:choose>
    <c:when test="${isLoginUser and startup.funding}"></c:when>
    <c:otherwise>
      <div class="panel panel-default zz-startup-panel">
	    <div class="panel-body">
	      
	      <ul class="nav nav-pills nav-justified zz-startup-social-nav bottom-margin-10">
	        <li class="active"><a href="javascript: void(0)" style="width: 50%;"><fmt:message key="${startup.fundStatus.key}"/></a></li>
	      </ul>
	      <ol class="list-unstyled clearfix bottom-padding-10 top-padding-10">
	        <li class="font-size-20">
	          <span class="text-light-gray col-xs-6 text-align-right">融资总额</span>
	          <b class="text-muted col-xs-6">&yen;&nbsp;<span class="text-prefunding"><fmt:formatNumber value="${startup.fund.total}" type="number" /></span>万</b>
	        </li>
	        <c:if test="${isLoginUser}">
	          <li class="font-size-20">
	            <span class="text-light-gray col-xs-6 pull-left text-align-right">出让股份</span>
	            <b class="text-muted col-xs-6"><span class="text-prefunding"><fmt:formatNumber value="${startup.fund.share}" type="number" /></span>&nbsp;%</b>
	          </li>
	        </c:if>
	      </ol>
	      <c:if test="${isLoginUser and startup.fundStatus.asRedisKey}">
	        <c:if test="${startup.prefunding}">
	          <a class="demo2do-radius-btn demo2do-radius-btn-primary" href="${ctx}/startups/${startup.id}/fund-progress/create" data-target="#" data-toggle="modal">申请领投</a>
	        </c:if>
	        <c:if test="${startup.latest}">
	          <a class="demo2do-radius-btn demo2do-radius-btn-primary" href="${ctx}/startups/${startup.id}/fund-progress/create" data-target="#" data-toggle="modal">预约投资</a>
	        </c:if>
	      </c:if>
	      
	    </div>
	  </div>
    </c:otherwise>
  </c:choose>
  
  <div class="panel panel-default zz-startup-panel">
	<div class="panel-body">
	            
	  <ul class="nav nav-pills nav-justified zz-startup-social-nav bottom-margin-10">
	    <li class="active"><a href="#startup-sidebar-rating" data-toggle="pill">评分</a></li>
	    <li><a href="#startup-sidebar-discussion" data-toggle="pill">讨论</a></li>
	  </ul>
	            
	  <div class="tab-content">
	           
	    <div class="tab-pane fade in active" id="startup-sidebar-rating">
	      <c:choose>
	        <c:when test="${empty latestRatings}">
	          <p class="text-deep-gray font-size-14 tab-pane-inner" style="line-height: 25px"><b>暂无评分信息</b></p>
	        </c:when>
	        <c:otherwise>
	          <ul class="media-list tab-pane-inner">
	            <c:forEach var="latestRating" items="${latestRatings}">
	              <li class="media">
	                <a class="pull-left" href="#"><img class="media-object" src="${ctx.upload}/${latestRating.profile.avatar}" width="56px" height="56px"></a>
	                <div class="media-body">
	                  <div class="media-heading font-size-16">
	                    <a class="no-text-decoration" href="#"><b>${latestRating.profile.name}</b></a>&nbsp;&nbsp;
	                    <span class="font-size-12 pull-right text-muted"><fmt:formatDate value="${latestRating.createTime}" pattern="MM月dd日"/></span>
	                    <p class="font-size-12 top-margin-10 text-muted line-ellipsis">${latestRating.investor.institution.profile.name}&nbsp;<b>·</b>&nbsp;${latestRating.investor.title}</p>
	                    <div class="font-size-12 text-danger">
	                      <div class="show-rating display-inline-block" data-score="${latestRating.star}"></div>&nbsp;<span class="show-rating-hint label label-success"></span>
	                    </div>
	                  </div>
	                  <p class="box-ellipsis font-size-12">${latestRating.reason}</p>
	                </div>
	              </li>
	            </c:forEach>
	          </ul>
	        </c:otherwise>
	      </c:choose>
	    
          <div class="clearfix">
            <a class="demo2do-radius-btn demo2do-radius-btn-primary" href="${ctx}/startups/${startup.id}/ratings#rating-form"><i class="glyphicon glyphicon-stats font-size-12"></i>&nbsp;&nbsp;参与评分</a>
            <a class="pull-right" href="${ctx}/startups/${startup.id}/ratings">查看全部${startup.ratingCount}条评分&nbsp;&gt;&gt;</a>
          </div>
        </div><!-- #startup-sidebar-rating -->
        
        <div class="tab-pane fade" id="startup-sidebar-discussion">
          <c:choose>
            <c:when test="${empty latestDiscussions}">
              <p class="text-deep-gray font-size-14 tab-pane-inner" style="line-height: 25px"><b>暂无讨论信息</b></p>
            </c:when>
            <c:otherwise>
              <ul class="media-list tab-pane-inner">
	            <c:forEach var="latestDiscussion" items="${latestDiscussions}">
	            <li class="media">
	              <a class="pull-left" href="#"><img class="media-object" src="${ctx.upload}/${latestDiscussion.profile.avatar}" width="56px" height="56px"></a>
	              <div class="media-body">
	                <div class="media-heading font-size-16">
	                  <a href="#"><b>${latestDiscussion.profile.name}</b></a>&nbsp;&nbsp;
	                  <span class="font-size-12 pull-right text-muted"><fmt:formatDate value="${latestDiscussion.createTime}" pattern="MM月dd日" /></span>
	                  <p class="font-size-12 top-margin-10 text-muted line-ellipsis">${latestDiscussion.investor.institution.profile.name}&nbsp;<b>·</b>&nbsp;${latestDiscussion.investor.title}</p>
	                </div>
	                <p class="box-ellipsis font-size-12">${latestDiscussion.content}</p>
	              </div>
	            </li>
	            </c:forEach>
	          </ul>
            </c:otherwise>
          </c:choose>
          
          <div class="clearfix">
            <a class="demo2do-radius-btn demo2do-radius-btn-primary" href="${ctx}/startups/${startup.id}/discussions#discussion-form"><i class="glyphicon glyphicon-edit font-size-12"></i>&nbsp;&nbsp;参与讨论</a>
            <a class="pull-right" href="${ctx}/startups/${startup.id}/discussions">查看全部${startup.discussionCount}条讨论&nbsp;&gt;&gt;</a>
          </div>
        </div><!-- #startup-sidebar-discussion -->
        
      </div>
      
    </div>
  </div>
  
  <div class="panel panel-default zz-startup-panel">
    <div class="panel-body">
      
      <ul class="nav nav-pills nav-justified zz-startup-social-nav bottom-margin-10">
        <li class="active"><a href="#startup-sidebar-meet" data-toggle="pill">约谈</a></li>
        <li><a href="#startup-sidebar-fan" data-toggle="pill">关注</a></li>
      </ul>
      
      <div class="tab-content">
        
        <div class="tab-pane fade in active" id="startup-sidebar-meet">
          <c:choose>
            <c:when test="${empty latestMeets}">
              <p class="text-deep-gray font-size-14 tab-pane-inner" style="line-height: 25px"><b>暂无约谈信息</b></p>
            </c:when>
            <c:otherwise>
              <ul class="media-list tab-pane-inner">
	            <c:forEach var="latestMeet" items="${latestMeets}">
	              <li class="media">
	                <a class="pull-left" href="#"><img class="media-object" src="${ctx.upload}/${latestMeet.profile.avatar}" width="56px" height="56px"></a>
	                <div class="media-body">
	                  <div class="media-heading font-size-16">
	                    <a class="no-text-decoration" href="#"><b>${latestMeet.profile.name}</b></a>&nbsp;&nbsp;
	                    <span class="font-size-12 pull-right text-muted"><fmt:formatDate value="${latestMeet.createTime}" pattern="MM月dd日"/></span>
	                    <p class="font-size-12 top-margin-10 text-muted line-ellipsis">${latestMeet.investor.institution.profile.name}&nbsp;<b>·</b>&nbsp;${latestMeet.investor.title}</p>
	                  </div>
	                </div>
	              </li>
	            </c:forEach>
	          </ul>
            </c:otherwise>
          </c:choose>
        
          <div class="clearfix">
            <c:if test="${isLoginUser}">
              <a class="demo2do-radius-btn demo2do-radius-btn-primary" href="${ctx}/startups/${startup.id};tab=detail/create-meet" data-target="#" data-toggle="modal"><i class="glyphicon glyphicon-plane font-size-12"></i>&nbsp;&nbsp;约谈项目</a>
            </c:if>
            <a class="pull-right" href="${ctx}/startups/${startup.id}/meets">查看全部${startup.meetCount}条约谈&nbsp;&gt;&gt;</a>
          </div>
        </div><!-- #startup-sidebar-meet -->
        
        <div class="tab-pane fade" id="startup-sidebar-fan">
          <c:choose>
            <c:when test="${empty latestFans}">
              <p class="text-deep-gray font-size-14 tab-pane-inner" style="line-height: 25px"><b>暂无粉丝信息</b></p>
            </c:when>
            <c:otherwise>
              <ul class="list-inline tab-pane-inner">
	            <c:forEach var="latestFan" items="${latestFans}">
	            <li><img class="bottom-margin-10" src="${ctx.upload}/${latestFan.profile.avatar}" width="50px" height="50px"></li>
	            </c:forEach>
	          </ul>
            </c:otherwise>
          </c:choose>
          
          <div class="clearfix">
            <a class="pull-right" href="${ctx}/startups/${startup.id}/fans">查看全部${startup.fansCount}位粉丝&nbsp;&gt;&gt;</a>
          </div>
        </div><!-- #startup-sidebar-fans -->
        
      </div>
      
    </div>
  </div>
  
</div><!-- zz-startup-right-layout -->